<%--
  Created by IntelliJ IDEA.
  User: 33536
  Date: 2022/5/19
  Time: 10:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>添加班级</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/ajaxForm.js"></script>
</head>
<script>
    layui.use(['form', 'laydate', 'layer'], function () {
        var form = layui.form, laydate = layui.laydate, layer = layui.layer;
        form.on('submit(formBtn)',function(data){
            var formData = new FormData($("#formsbt")[0]);
            $.ajax({
                url:'${pageContext.request.contextPath}/juris/adddabian',
                type : 'POST',
                data : formData,
                cache: false,
                async: false,
                processData : false,  //必须false才会避开jQuery对 formdata 的默认处理
                contentType : false,  //必须false才会自动加上正确的Content-Type
                success:function(data){
                    layer.msg('添加成功！',{icon:6,offset:"auto",time:2000});//提示框
                    setTimeout(function(){
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);//关闭弹出层
                        parent.location.reload("demo");//重新加载父页面表格
                    }, 1100);
                }
            })
            return false;
        });



    });
</script>
<body>
<form class="layui-form" id="formsbt">

    <%--    答辩项目名称--%>
    <div class="layui-form-item" >
        <label class="layui-form-label" style="width: 150px">答辩项目名称：</label>
        <div class="layui-input-inline">
            <input type="text" name="projectName" class="layui-input" placeholder="请输入答辩项目名称" lay-verify="required" />
        </div>
    </div>

    <%--    答辩项目说明--%>
    <div class="layui-form-item">
        <label class="layui-form-label"  style="width: 150px">答辩项目说明：</label>
        <div class="layui-input-inline">
            <input type="text" name="remark" class="layui-input" placeholder="请输入答辩项目说明" lay-verify="required" />
        </div>
    </div>



    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <button class="layui-btn" lay-submit lay-filter="formBtn">添加</button>
        </div>
    </div>
</form>
</body>
</html>